<extend name="Public/base"/>

<!-- 子導航 -->
<block name="sidebar">
    <include file="sidemenu" />
</block>

<block name="body">
    <!-- 標題欄 -->
    <div class="main-title">
        <h2>會員列表({:count($list)})</h2>
    </div>

    <div class="cf">
        <div class="fl">
            <a class="btn" href="{:U('Article/useradd')}">新 增</a>
        </div>

        <!-- 高級搜索 -->
        <div class="search-form fr cf">
            <div class="sleft">
                <input type="text" name="nickname" class="search-input" value="{:I('nickname')}" placeholder="請輸入用戶昵稱或者ID">
                <a class="sch-btn" href="javascript:;" id="search" url="{:U('Admin/Article/userlist','','')}"><i class="btn-search"></i></a>
            </div>
        </div>
    </div>
    <!-- 數據列表 -->
    <div class="data-table table-striped">
        <table class="">
            <thead>
                <tr>
                    <th class="row-selected row-selected"><input class="check-all" type="checkbox"/></th>
                    <th class="">UID</th>
                    <th class="">用戶名</th>
                    <th class="">卡號</th>		
                    <th class="">操作</th>
                </tr>
            </thead>
            <tbody>
            <notempty name="list">
                <volist name="list" id="vo">
                    <tr>
                        <td><input class="ids" type="checkbox" name="id[]" value="{$vo.id}" /></td>
                        <td>{$vo.id} </td>
                        <td><a href="{:U('Article/useredit?&uid='.$vo['id'])}">{$vo.username}</a></td>
                        <td>{$vo.account}</td>
                        <!--			<td>{$vo.login}</td>
                                                <td><span>{$vo.last_login_time|time_format}</span></td>
                                                <td><span>{:long2ip($vo['last_login_ip'])}</span></td>
                                                <td>{$vo.status_text}</td>-->
                        <td>
                            <!--<eq name="vo.status" value="1">
                                                            <a href="{:U('User/changeStatus?method=forbidUser&id='.$vo['uid'])}" class="ajax-get">禁用</a>
                                                            <else/>
                                                            <a href="{:U('User/changeStatus?method=resumeUser&id='.$vo['uid'])}" class="ajax-get">啟用</a>
                                                            </eq>-->
                            <a href="{:U('Article/useredit?&uid='.$vo['id'])}">編輯</a>
                            <a href="{:U('Article/userdel?id='.$vo['id'])}" class="confirm ajax-get">刪除</a>
                        </td>
                    </tr>
                </volist>
                <else/>
                <td colspan="9" class="text-center"> aOh! 暫時還沒有內容! </td>
            </notempty>
            </tbody>
        </table>
    </div>
    <div class="page">
        {$_page}
    </div>

</block>
<block name="script">
    <!--<link href="__STATIC__/datetimepicker/css/datetimepicker.css" rel="stylesheet" type="text/css">
    <php>if(C('COLOR_STYLE')=='blue_color') echo '<link href="__STATIC__/datetimepicker/css/datetimepicker_blue.css" rel="stylesheet" type="text/css">';</php>
    <link href="__STATIC__/datetimepicker/css/dropdown.css" rel="stylesheet" type="text/css">
    <script type="text/javascript" src="__STATIC__/datetimepicker/js/bootstrap-datetimepicker.min.js"></script>
    <script type="text/javascript" src="__STATIC__/datetimepicker/js/locales/bootstrap-datetimepicker.zh-CN.js" charset="UTF-8"></script>
    <script type="text/javascript">
        $(function () {
            //搜索功能
            $("#search").click(function () {
                var url = $(this).attr('url');
                var status = $("#sch-sort-txt").attr("data");
                var query = $('.search-form').find('input').serialize();
                query = query.replace(/(&|^)(\w*?\d*?\-*?_*?)*?=?((?=&)|(?=$))/g, '');
                query = query.replace(/^&/g, '');
                if (status != '') {
                    query += 'status=' + status + "&" + query;
                }
                if (url.indexOf('?') > 0) {
                    url += '&' + query;
                } else {
                    url += '?' + query;
                }
                window.location.href = url;
            });

            /* 狀態搜索子菜單 */
            $(".search-form").find(".drop-down").hover(function () {
                $("#sub-sch-menu").removeClass("hidden");
            }, function () {
                $("#sub-sch-menu").addClass("hidden");
            });
            $("#sub-sch-menu li").find("a").each(function () {
                $(this).click(function () {
                    var text = $(this).text();
                    $("#sch-sort-txt").text(text).attr("data", $(this).attr("value"));
                    $("#sub-sch-menu").addClass("hidden");
                })
            });

            //只有壹個模型時，點擊新增
            $('.document_add').click(function () {
                var url = $(this).attr('url');
                if (url != undefined && url != '') {
                    window.location.href = url;
                }
            });

            //點擊排序
            $('.list_sort').click(function () {
                var url = $(this).attr('url');
                var ids = $('.ids:checked');
                var param = '';
                if (ids.length > 0) {
                    var str = new Array();
                    ids.each(function () {
                        str.push($(this).val());
                    });
                    param = str.join(',');
                }

                if (url != undefined && url != '') {
                    window.location.href = url + '/ids/' + param;
                }
            });

            //回車自動提交
            $('.search-form').find('input').keyup(function (event) {
                if (event.keyCode === 13) {
                    $("#search").click();
                }
            });

            $('#time-start').datetimepicker({
                format: 'yyyy-mm-dd',
                language: "zh-CN",
                minView: 2,
                autoclose: true
            });

            $('#time-end').datetimepicker({
                format: 'yyyy-mm-dd',
                language: "zh-CN",
                minView: 2,
                autoclose: true
            });
        })
    </script>-->
</block>